<html>
<head>
    <title>序列内置函数</title>
</head>
<body>

<#-- chunk -->
<#assign seq = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']>
<#list seq?chunk(4) as row>
    <#list row as cell>${cell} </#list>
</#list>

<#list seq?chunk(4,"-") as row>
    <#list row as cell>${cell} </#list>
</#list>

<#-- first -->
<#assign seq2 = ['a', 'b', 'c']>
first = ${seq2?first}

<#-- join -->
<#assign colors = ["red", "green", "blue"]>
${colors?join(", ")}

${colors?join(", ", "-")}
${[]?join(", ", "-")}

${colors?join(", ", "-", ".")}
${[]?join(", ", "-", ".")}

<#-- last -->
<#assign seq3 = ['a', 'b', 'c']>
last = ${seq3?last}

<#-- reverse -->
<#assign seq4 = ['a', 'b', 'c']>
<#list seq4 as item>${item}<#sep>, </#list>

<#-- seq_contains -->
<#assign x = ["red", 16, "blue", "cyan"]>
"blue": ${x?seq_contains("blue")?string("yes", "no")}
"yellow": ${x?seq_contains("yellow")?string("yes", "no")}
16: ${x?seq_contains(16)?string("yes", "no")}
"16": ${x?seq_contains("16")?string("yes", "no")}




</body>
</html>